﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZyGames.Framework.Model;

namespace ZyGames.DZPocker.Model
{
	/// <summary>
	/// 玩家牌桌表
	/// </summary>
	[Serializable, ProtoContract]
	[EntityTable(CacheType.Entity, DbConfig.Data, IsExpired = false)]
	public class SharedUserAndTable : ShareEntity
	{
		public SharedUserAndTable()
			: base(false)
		{
		}
		public SharedUserAndTable(int userId, int tableId)
			: this()
		{
			this.UserID = userId;
			this.TableID = tableId;
		}

		/// <summary>
		/// 玩家ID
		/// </summary>        
		[ProtoMember(1)]
		[EntityField(true)]
		public int UserID { get; set; }

		/// <summary>
		/// 桌子ID
		/// </summary>        
		[ProtoMember(2)]
		[EntityField(true)]
		public int TableID { get; set; }

		/// <summary>
		/// 盈亏(玩家在这个桌子的盈亏)
		/// </summary>        
		[ProtoMember(3)]
		[EntityField]
		public int Profit { get; set; }

		/// <summary>
		/// 总带入
		/// </summary>
		[ProtoMember(4)]
		[EntityField]
		public int TotalBuy { get; set; }

		/// <summary>
		/// 是否是保险人
		/// </summary>
		[ProtoMember(5)]
		[EntityField]
		public bool IsInsurance { get; set; }
	}
}
